package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.service.IOrderDeliveryDetailService;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.OrderDeliveryDetailMapper;
import com.ly.heart.domain.OrderDeliveryDetailEntity;

import javax.annotation.Resource;

/**
 * 采购订单交货明细Service业务层处理
 *
 * @author cxl
 * @date 2024-06-06
 */
@Service
public class OrderDeliveryDetailServiceImpl extends ServiceImpl<OrderDeliveryDetailMapper,OrderDeliveryDetailEntity> implements IOrderDeliveryDetailService {

    @Resource
    private OrderDeliveryDetailMapper orderDeliveryDetailMapper;

    /**
     * 查询采购订单交货明细
     *
     * @param id 采购订单交货明细ID
     * @return 采购订单交货明细
     */
    @Override
    public OrderDeliveryDetailEntity selectOrderDeliveryDetailEntityById(String id)
    {
        return orderDeliveryDetailMapper.selectOrderDeliveryDetailEntityById(id);
    }

    /**
     * 查询采购订单交货明细列表
     *
     * @param orderDeliveryDetailEntity 采购订单交货明细
     * @return 采购订单交货明细
     */
    @Override
    public List<OrderDeliveryDetailEntity> selectOrderDeliveryDetailEntityList(OrderDeliveryDetailEntity orderDeliveryDetailEntity)
    {
        return orderDeliveryDetailMapper.selectOrderDeliveryDetailEntityList(orderDeliveryDetailEntity);
    }

    /**
     * 新增采购订单交货明细
     *
     * @param orderDeliveryDetailEntity 采购订单交货明细
     * @return 结果
     */
    @Override
    public int insertOrderDeliveryDetailEntity(OrderDeliveryDetailEntity orderDeliveryDetailEntity)
    {
        orderDeliveryDetailEntity.setCreateTime(DateUtils.getNowDate());
        return orderDeliveryDetailMapper.insertOrderDeliveryDetailEntity(orderDeliveryDetailEntity);
    }

    /**
     * 修改采购订单交货明细
     *
     * @param orderDeliveryDetailEntity 采购订单交货明细
     * @return 结果
     */
    @Override
    public int updateOrderDeliveryDetailEntity(OrderDeliveryDetailEntity orderDeliveryDetailEntity)
    {
        return orderDeliveryDetailMapper.updateOrderDeliveryDetailEntity(orderDeliveryDetailEntity);
    }

    /**
     * 批量删除采购订单交货明细
     *
     * @param ids 需要删除的采购订单交货明细ID
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryDetailEntityByIds(String[] ids)
    {
        return orderDeliveryDetailMapper.deleteOrderDeliveryDetailEntityByIds(ids);
    }

    /**
     * 删除采购订单交货明细信息
     *
     * @param id 采购订单交货明细ID
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryDetailEntityById(String id)
    {
        return orderDeliveryDetailMapper.deleteOrderDeliveryDetailEntityById(id);
    }
}
